#include "sCIEdit.h"
#include "sComponentEdit.h"
#include "sActionHandlerEditText.h"
#include "sGUI.h"

namespace sgui
{
namespace inst
{

sComponentInstanceEdit::sComponentInstanceEdit(sGUI& gui, const res::sComponentObject& object, sComponentInstance* parent) :
	sComponentInstanceLabel(gui, object, parent)
{

}
   
void sComponentInstanceEdit::OnEventPressed()
{
    //
}
   
bool sComponentInstanceEdit::OnHandlerEvent(const sActionHandlerEvent& event)
{
    switch (event.getID())
    {
        case EAEID_PRESS:
        {
            OnEventPressed();
            return true;
        }
    }
    return false;
}
    
bool sComponentInstanceEdit::OnPress(const obs::sMousePressEvent& event, sComponentRectInstance* rect)
{
    switch (rect->getID())
    {
        case res::sComponentEdit::REQUIRED_RECT_TEXT:
        {
			sActionHandlerEditText *ev = new sActionHandlerEditText(this, rect);
            getGui().setHandler(ev, &event);
			return ev->OnEvent(event);
        }
    }

    return false;
}

sComponentInstanceEdit::~sComponentInstanceEdit()
{
	//
}

};
};